
nums = [2, 7, 11, 15]
target = 4

# 两数之和
def two_sum(nums, target):
    for i in range(len(nums)):
        for j in range( len(nums)):
            if nums[i] + nums[j] == target:
               return [i, j]




print(two_sum(nums, target))